package com.yuanfeng.order.controller;

import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.order.dto.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName OrderCommissionController
 * @Description
 * @Author hyq
 * @Date 2023/7/14 9:44
 * @Version 1.0
 **/
@RestController
@RequestMapping("order/commission")
public class OrderCommissionController extends BaseController{

    /**
     * 微客列表导出
     * @param vkUser
     * @return
     */
    @PostMapping("/queryVkUserListExp")
    public ResponseResult queryVkUserListExp(@RequestBody VKUserDTO vkUser){
        ResponseResult result = orderCommissionService.queryVkUserListExp(vkUser);
        return result;
    }

    /**
     * 微客列表查询
     * @param fxGoodsInfo
     * @return
     */
    @RequestMapping("/queryFxGoodsList")
    public ResponseResult queryFxGoodsList(@RequestBody FxGoodsInfoDTO fxGoodsInfo) throws IllegalAccessException {
        ResponseResult result = orderCommissionService.queryFxGoodsList(fxGoodsInfo);
        return result;
    }

    /**
     * 微客列表查询
     * @param vkUser
     * @return
     */
    @RequestMapping("/queryVkUserList")
    public ResponseResult queryVkUserList(@RequestBody VKUserDTO vkUser) throws IllegalAccessException {
        ResponseResult result = orderCommissionService.queryVkUserList(vkUser);
        return result;
    }

    /**
     * 商家中心 --查询微客分销业绩订单
     * @param mallOrderQuery
     * @return
     */
    @PostMapping("/shopVkCommission")
    public ResponseResult shopVkCommission(@RequestBody MallOrderDTO mallOrderQuery){
        ResponseResult result = orderCommissionService.shopVkCommission(mallOrderQuery);
        return result;
    }

    /**
     * 查询分销结算列表
     * @param settleList
     * @return
     */
    @PostMapping("/h5/queryCommissionSettle")
    public ResponseResult queryCommissionSettle(@RequestBody FxOrderListDTO settleList) throws IllegalAccessException {
        ResponseResult result = orderCommissionService.queryCommissionSettle(settleList);
        return result;
    }

    /**
     * 推广用户列表
     * @param tgUser
     * @return
     */
    @PostMapping("/h5/queryTgUser")
    public ResponseResult queryTgUser(@RequestBody TgUserDTO tgUser){
        ResponseResult result = orderCommissionService.queryTgUser(tgUser);
        return result;
    }

    /**
     * 查询用户支付 售后单详情
     * @param tgUser
     * @return
     */
    @PostMapping("/h5/queryTgUserDetail")
    public ResponseResult queryTgUserDetail(@RequestBody TgUserDTO tgUser){
        ResponseResult result = orderCommissionService.queryTgUserDetail(tgUser);
        return result;
    }

    /**
     * 今日预计收益
     * @param settleList
     * @return
     */
    @PostMapping("/h5/queryTodaySettle")
    public ResponseResult queryTodaySettle(@RequestBody FxOrderListDTO settleList){
        ResponseResult result = orderCommissionService.queryTodaySettle(settleList);
        return result;
    }

    /**
     * 查询佣金订单
     * @param orderList
     * @return
     */
    @PostMapping("/h5/queryCommissionOrder")
    public ResponseResult queryCommissionOrder(@RequestBody FxOrderListDTO orderList){
        ResponseResult result = orderCommissionService.queryCommissionOrder(orderList);
        return result;
    }


    /**
     * 佣金统计
     *
     * @param settleList
     * @return
     */
    @PostMapping("/queryUserCommission")
    public ResponseResult queryUserCommission(@RequestBody FxOrderListDTO settleList) {
        ResponseResult result=orderCommissionService.queryUserCommission(settleList);
        return result;
    }
}
